package com.yhsimon.demo3;

import com.yhsimon.demo.UserService;
import com.yhsimon.demo.UserServiceImpl;

public class Client {
    public static void main(String[] args) {
        //被代理的接口 真实对象
        UserService userService=new UserServiceImpl();

        //代理角色
        ProxyInvocationHandler pih = new ProxyInvocationHandler();
        pih.setTarget(userService);

        //动态生成代理类
        UserService proxy = (UserService) pih.getProxy();

        proxy.add();


    }
}

